package com.stichedtogether.test;

import java.io.Serializable;
import javax.sql.DataSource;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

public class DatabaseDriver implements Serializable {


	private static final long serialVersionUID = 8581349343069048984L;

	static DriverManagerDataSource dataSource =null;

	public static DataSource getDataSource(){
		if(dataSource==null){
			dataSource = new DriverManagerDataSource();
			dataSource.setDriverClassName("com.mysql.jdbc.Driver");
			dataSource.setUrl("jdbc:mysql://localhost:3306/ma345project"); 
			dataSource.setUsername("root");
			dataSource.setPassword("");
		}
		return dataSource;
	}
}